<template>
    <div class="container">
        <div class="list" @click="selectMenu" data-id="1" :class="num==1?'active':''">
            <div class="list-child1">
                首页
            </div>
            <p :class="num==1?'active-p':''"></p>
        </div>
        <div class="list" @click="selectMenu" data-id="2" :class="num==2?'active':''">
            <div class="list-child1">
                活动
            </div>
            <p :class="num==2?'active-p':''"></p>
        </div>
        <div class="list" @click="selectMenu" data-id="3" :class="num==3?'active':''">
            <div class="list-child1">
                游戏卡券
            </div>
            <p :class="num==3?'active-p':''"></p>
        </div>
        <div class="list" @click="selectMenu" data-id="4" :class="num==4?'active':''">
            <div class="list-child1">
                商家中心
            </div>
            <p :class="num==4?'active-p':''"></p>
        </div>
    </div>
</template>

<script>
    export default {
        name: "foot",
        data(){
            return{
            }
        },
        methods:{
            selectMenu(e){
                let id = e.currentTarget.dataset.id;
                switch (id){
                    case '1':
                        this.$router.push('/');
                        break;
                    case '2':
                        this.$router.push('/promote');
                        break;
                    case '3':
                        this.$router.push('/card');
                        break;
                    case '4':
						this.$router.push('/fprint');
                        break;
                }
            },
        },
        props:{
            num:{
                type:Number,
            },
        },
    }
</script>

<style scoped>
    .container{
        width: 100%;
        height: 2.88rem;
        position: fixed;
        bottom: 0;
        left: 0;
        display: flex;
        justify-content: space-between;
        z-index: 90;
        background-color: #FFFFFF;
        box-shadow: 0 -1px 1px rgba(0,0,0,.1);
    }
    .container > .list{
        width:25%;
        height:100%;
        line-height: 2rem;
        text-align: center;
        color: #666666;
    }
    .container > .list:focus{
        color:#56b176;
    }
    .container > .list > .list-child1{
        font-size: .9rem;
        line-height: 2.8rem;
        height: 2rem;
        font-weight: bold;
    }
    .container > .list > .list-child > i{
        font-size: 1.5rem;
    }
    .active{
        color:#333 !important;
    }
    .active-p{
        height: 4px;
        background: #2C6EFE;
        width: 25%;
        margin: auto;
        border-radius: 2px;
        box-shadow: 0 2px 3px rgba(44,110,254,0.6);;
    }
</style>